package com.byq.ai.agentlab.po;

import org.springframework.ai.chat.messages.*;

public class MyMessage {
    String content;

    MessageType type;
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public MessageType getType() {
        return type;
    }

    public void setType(MessageType type) {
        this.type = type;
    }
    public Message toMessage(){
        if(type == MessageType.USER)
            return new UserMessage(content);
        if(type == MessageType.SYSTEM)
            return new SystemMessage(content);
        if(type == MessageType.ASSISTANT)
            return new AssistantMessage(content);
        return null;
    }
    public void fromMessage(Message m){
       type = m.getMessageType();
       content = m.getText();

    }


}
